<template>
  <view class="p-baidu">
    <x-button styles="background: none;border: none;padding: 0;height: inherit; line-height: 1" open-type="launchApp" app-parameter="wechat" @error="launchAppError">
      <view class="back">返回{{AppName}}</view>
    </x-button>
  </view>
</template>

<script>
import XButton from '@/components/x-button/index.vue';

export default {
  name: 'PBaidu',
  components: {
    XButton
  },
  props: {
    referrerInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      showCountdown: true,
      countdownData: {}
    };
  },
  computed: {
    AppName() {
      const appList = [
        {
          name: '百度APP',
          appId: 'wx27a43222a6bf2931'
        },
        {
          name: '百度APP极速版',
          appId: 'wx6d2ad6ce3e1cd86e'
        },
        {
          name: '百度贴吧',
          appId: 'wx289a8c58bca4c71e'
        },
        {
          name: '好看视频',
          appId: 'wx89e0af9d1faca777'
        },
        {
          name: '百度网盘',
          appId: 'wx65cffe5f882034d1'
        },
        {
          name: '百度地图',
          appId: 'wx9a08a4f59ce91bf6'
        }
      ];
      const appInfo = appList.filter((item) => item.appId === this.referrerInfo.appId);
      if (appInfo.length > 0) {
        return appInfo[0].name;
      } else {
        return '';
      }
    }
  },
  watch: {},
  created() {

  },
  methods: {
    launchAppError(e) {
      console.log(e);
    }
  }
};
</script>

<style lang="scss" scoped>
  .p-baidu{
    background: rgba(255,255,255, 0.6);
    position: fixed;
    top: 200px;
    left: 0;
    z-index: 999;
    border-top-right-radius: 100px;
    border-bottom-right-radius: 100px;
    .back {
      padding: 15px 24px;
      font-size: 30px;
      color: #333333;
    }
  }
</style>
